<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.sql.*"%>

<%
	String driver = "org.postgresql.Driver";
	String url = "jdbc:postgresql://localhost/android";
	String usuario = "postgres";
	String senha = "123";
	Connection conexao;
	Statement statement;
	ResultSet resultSet;
	try{
		Class.forName(driver);
		conexao = DriverManager.getConnection(url, usuario, senha);
		System.out.println("-----------------Conexão OK!---------------");
		statement = conexao.createStatement();
		String sql = "delete from usuario where nome = '"+request.getParameter("nomeP")+"'";
		int resposta = statement.executeUpdate(sql);
		if(resposta == 1)
			out.print("Excluido com Sucesso.");
		else
			out.print("Falha ao excluir.");
		
	}catch(ClassNotFoundException Driver){
		out.print("Driver não localizado:" + Driver);
	}catch(SQLException fonte){
		out.print("Erro de conexão"+ fonte);
	}
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Server Android - Delete</title>
</head>
<body>
<h2>Excluir..</h2>

</body>
</html>